/**
 * xdemo.org
 */
package org.xdemo.site.biz.portal.demo.bean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * @作者 Goofy
 * @邮件 252878950@qq.com
 * @日期 2014-1-1
 * @描述 Demo的附件
 */
@Entity
@Table(name="demoAttachment")
public class DemoAttachment {
	
	@Id
	@GenericGenerator(name="idGenerator",strategy="uuid")//ID生成器属性包括生成器ID，生成策略
	@GeneratedValue(generator="idGenerator")//引用ID生成器
	@Column(length=64)
	private String demoAttachmentId;
	/**
	 * 真实路径
	 */
	@Column(nullable=false,length=128)
	private String realPath;
	/**
	 * 文件原始名称
	 */
	@Column(nullable=false,length=128)
	private String originName;
	/**
	 * 文件大小
	 */
	@Column(nullable=false,length=9)
	private Long size;
	/**
	 * 关联的Demo
	 */
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="demoId")
	private Demo demo;
	public String getDemoAttachmentId() {
		return demoAttachmentId;
	}
	public void setDemoAttachmentId(String demoAttachmentId) {
		this.demoAttachmentId = demoAttachmentId;
	}
	public String getRealPath() {
		return realPath;
	}
	public void setRealPath(String realPath) {
		this.realPath = realPath;
	}
	public String getOriginName() {
		return originName;
	}
	public void setOriginName(String originName) {
		this.originName = originName;
	}
	public Long getSize() {
		return size;
	}
	public void setSize(Long size) {
		this.size = size;
	}
	public Demo getDemo() {
		return demo;
	}
	public void setDemo(Demo demo) {
		this.demo = demo;
	}
	
}
